﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Wicresoft.SMS.Web.Models;

namespace Wicresoft.SMS.Web.Controllers
{
    public class TestAuthoriseController : CustomBaseController
    {
        //
        // GET: /TestAuthorise/

        public ActionResult Index()
        {
            UserSetting us = new UserSetting();
            //the user name can be find in User.Identity.Name,here just a demo
            us.UserName = "parker";
            //parker will display
            us.Alias = "parker";
            us.DisplayName = "Paker Zhou";
            us.Password = "111111";
            us.IsAdmin = true;
            us.TextArea = "textarea";
            us.IsRadio1 = true;

            List<SelectorItem> list = new List<SelectorItem>()
            {
                new SelectorItem{ ValueInt = 1 , DisplayString = "1" },
                new SelectorItem{ ValueInt = 2 , DisplayString = "2" },
                new SelectorItem{ ValueInt = 3 , DisplayString = "3" }
            };

            us.selector = new SelectList(list, "ValueInt", "DisplayString",1);
            

            ViewData["model"] = us;

            return View();
        }

        public ActionResult CatchData(UserSetting us)
        {
            return View(us);
        }

    }
}
